//
//  KTAwardPushTVC.m
//  KTLotteryTicket
//
//  Created by CoolKi on 16/3/12.
//  Copyright © 2016年 CoolKi. All rights reserved.
//

#import "KTAwardPushTVC.h"

@interface KTAwardPushTVC ()

@end

@implementation KTAwardPushTVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setGroup1];
    
}


- (void)setGroup1{
    
    KTSwitchCellModel * model0 = [KTSwitchCellModel cellModelByCellTitle:@"开奖推送" DetailTitle:@"" AndIconImageName:@""];
    model0.detailTitleStr = @"每周二，四，日开奖";
    model0.taskBlock = ^(BOOL isOP){
        NSLog(@"switch0 ＝ %d",isOP);
    };
    
    KTSwitchCellModel * model1 = [KTSwitchCellModel cellModelByCellTitle:@"大乐透" DetailTitle:@"" AndIconImageName:@""];
    model1.detailTitleStr  = @"每周一，三，六开奖";
    model1.taskBlock = ^(BOOL isOP){
        NSLog(@"switch1 ＝ %d",isOP);
    };
    
    KTSwitchCellModel * model2 = [KTSwitchCellModel cellModelByCellTitle:@"3D" DetailTitle:@"" AndIconImageName:@""];
    model2.detailTitleStr = @"开奖everyDay";
    model2.taskBlock = ^(BOOL isOP){
        NSLog(@"switch2 ＝ %d",isOP);
    };
    
    KTSwitchCellModel * model3 = [KTSwitchCellModel cellModelByCellTitle:@"七星彩" DetailTitle:@"" AndIconImageName:@""];
    model3.detailTitleStr = @"每周二，五，日开奖";
    model3.taskBlock = ^(BOOL isOP){
        NSLog(@"switch3 ＝ %d",isOP);
    };
    
    KTSwitchCellModel * model4 = [KTSwitchCellModel cellModelByCellTitle:@"排列三" DetailTitle:@"" AndIconImageName:@""];
    model4.detailTitleStr = @"每天开奖";
    model4.taskBlock = ^(BOOL isOP){
        NSLog(@"switch4 ＝ %d",isOP);
    };
    
    KTSwitchCellModel * model5 = [KTSwitchCellModel cellModelByCellTitle:@"排列五" DetailTitle:@"" AndIconImageName:@""];
    model5.detailTitleStr = @"每天开奖";
    model5.taskBlock = ^(BOOL isOP){
        NSLog(@"switch5 ＝ %d",isOP);
    };
    
    
    KTGroupModel * groupModel = [KTGroupModel groupModelWithHeaderTitle:@"区头标题" FooterTitle:@"区脚标题" CellModelArr:@[model0,model1,model2,model3,model4,model5]];
    
    
    groupModel.headerStr = @"1,headerStr";
    groupModel.footerStr = @"1footerStr";
    
    [self.groupArr addObject:groupModel];
}

//重写集类方法，实现cellStyle的改变
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    KTBaseCell * cell = [KTBaseCell cellWithTableView:tableView Style:UITableViewCellStyleSubtitle];//在此改变cell的style
    
    KTGroupModel * model = self.groupArr[indexPath.section];
    KTBaseCellModel * cellModel = model.cellModelArr[indexPath.row];
    cell.cellModel = cellModel;
    
    return cell;
}

@end
